const mongoose = require('mongoose');

const productSchema = new mongoose.Schema({
    name: { type: String, required: true },
    price: { type: Number },
    category: { type: String },
    createdAt: { type: Number }
});
// 添加复合索引
productSchema.index({ category: 1, price: 1 });
module.exports = mongoose.model('Product', productSchema);
